<?php


namespace app\project\model;


use app\user\model\User;
use think\Model;
use think\model\concern\SoftDelete;

class Project extends Model
{
    use SoftDelete;

    protected $deleteTime = 'delete_time';
    // 设置json类型字段
    protected $json = ['config'];
    protected $defaultSoftDelete = 0;
    public function principalUser()
    {
        return $this->hasOne(User::class,'id','principal')->bind(['principal_name'=>'username']);
    }
    public function teamUser()
    {
        return $this->hasOne(User::class,'id','team')->bind(['team_name'=>'username']);
    }
    public function category()
    {
        return $this->hasOne(Category::class,'id','category_id')->bind(['category_name'=>'title']);
    }
}